﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OracleTableSync;
using System.IO;
using BusinessRule.Common;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CaptureAndPush cp = new CaptureAndPush();
            cp.Excute();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ReceiveAndDeal cp = new ReceiveAndDeal();
            cp.Excute();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SyncTableStructure st = new SyncTableStructure();
            st.Excute();
        }

        private void button4_Click(object sender, EventArgs e)
        {

            String receivePath = @"C:\Projects\OracleTableSync\OracleTableSync\pushFile\";
            DirectoryInfo mydir = new DirectoryInfo(receivePath);
            FileInfo[] files = mydir.GetFiles();
            Array.Sort(files, (f1, f2) => {
                return f1.Name.CompareTo(f2.Name);
            });

        }

        private void button5_Click(object sender, EventArgs e)
        {
            LogHelp.SetConfig();
            SyncTableAllData sa = new SyncTableAllData();
            //sa.DealSyncAllData();
            sa.ReceiveSyncAllData();
        }
    }
}
